#ifndef VERIFYCODEWIDGET_H
#define VERIFYCODEWIDGET_H

#include <QWidget>
#include <QRandomGenerator>

class VerifyCodeWidget : public QWidget
{
    Q_OBJECT

private:
    QRandomGenerator randomGenerator;
    QString verifyCode= "";

public:
    explicit VerifyCodeWidget(QWidget *parent = nullptr);

    //生成随机验证码
    QString generateVerifyCode();

    // 检验验证码是否匹配
    bool checkVerifyCode(const QString& verifyCode);

    // 重新生成验证码并显示到界面上
    void refreshVerifyCode();

    //事件
    void paintEvent(QPaintEvent *event) override;
    //点击刷新验证码
    void mousePressEvent(QMouseEvent* event) override;

signals:
};

#endif // VERIFYCODEWIDGET_H
